Optimal. Leaf size=202 \[ \frac {\left (c^3+3 i c^2 d+3 c d^2-3 i d^3\right ) x}{2 a (c-i d)^2 (c+i d)^3}+\frac {(3 c-i d) d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{a (i c-d)^3 (c-i d)^2 f}+\frac {(c-3 i d) d}{2 a (c-i d) (c+i d)^2 f (c+d \tan (e+f x))}-\frac {1}{2 (i c-d) f (a+i a \tan (e+f x)) (c+d \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 202, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3633, 3610,
3612, 3611} \begin {gather*} \frac {x \left (c^3+3 i c^2 d+3 c d^2-3 i d^3\right )}{2 a (c-i d)^2 (c+i d)^3}+\frac {d^2 (3 c-i d) \log (c \cos (e+f x)+d \sin (e+f x))}{a f (-d+i c)^3 (c-i d)^2}+\frac {d (c-3 i d)}{2 a f (c-i d) (c+i d)^2 (c+d \tan (e+f x))}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3610
Rule 3611
Rule 3612
Rule 3633
Rubi steps
\begin {align*} \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx &=-\frac {1}{2 (i c-d) f (a+i a \tan (e+f x)) (c+d \tan (e+f x))}+\frac {\int \frac {a (i c-3 d)+2 i a d \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{2 a^2 (i c-d)}\\ &=\frac {(c-3 i d) d}{2 a (c-i d) (c+i d)^2 f (c+d \tan (e+f x))}-\frac {1}{2 (i c-d) f (a+i a \tan (e+f x)) (c+d \tan (e+f x))}+\frac {\int \frac {-a \left (3 c d-i \left (c^2+2 d^2\right )\right )+a d (i c+3 d) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{2 a^2 (i c-d) \left (c^2+d^2\right )}\\ &=\frac {\left (c^3+3 i c^2 d+3 c d^2-3 i d^3\right ) x}{2 a (c-i d)^2 (c+i d)^3}+\frac {(c-3 i d) d}{2 a (c-i d) (c+i d)^2 f (c+d \tan (e+f x))}-\frac {1}{2 (i c-d) f (a+i a \tan (e+f x)) (c+d \tan (e+f x))}-\frac {\left ((3 c-i d) d^2\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{a (i c-d) \left (c^2+d^2\right )^2}\\ &=\frac {\left (c^3+3 i c^2 d+3 c d^2-3 i d^3\right ) x}{2 a (c-i d)^2 (c+i d)^3}+\frac {(3 c-i d) d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{a (i c-d)^3 (c-i d)^2 f}+\frac {(c-3 i d) d}{2 a (c-i d) (c+i d)^2 f (c+d \tan (e+f x))}-\frac {1}{2 (i c-d) f (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.99, size = 385, normalized size = 1.91 \begin {gather*} \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (-\frac {4 (3 c-i d) d^2 \text {ArcTan}\left (\frac {d \cos (f x)+c \sin (f x)}{-c \cos (f x)+d \sin (f x)}\right ) \left (\cos \left (\frac {e}{2}\right )+i \sin \left (\frac {e}{2}\right )\right )^2}{(c-i d)^2 f}+\frac {2 d^2 (3 i c+d) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right ) \left (\cos \left (\frac {e}{2}\right )+i \sin \left (\frac {e}{2}\right )\right )^2}{(c-i d)^2 f}-\frac {4 (3 c-i d) d^2 x (\cos (e)+i \sin (e))}{(c-i d)^2}+\frac {2 \left (c^3+3 i c^2 d+3 c d^2-3 i d^3\right ) x (\cos (e)+i \sin (e))}{(c-i d)^2}+\frac {(c+i d) \cos (2 f x) (i \cos (e)+\sin (e))}{f}+\frac {(c+i d) (\cos (e)-i \sin (e)) \sin (2 f x)}{f}+\frac {4 i (c+i d) d^3 (\cos (e)+i \sin (e)) \sin (f x)}{(c-i d) f (c \cos (e)+d \sin (e)) (c \cos (e+f x)+d \sin (e+f x))}\right )}{4 (c+i d)^3 (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.45, size = 163, normalized size = 0.81
method | result | size |
derivativedivides | \(\frac {\frac {d^{2} \left (3 i c +d \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (i d -c \right )^{2} \left (i d +c \right )^{3}}-\frac {i d^{2} \left (c^{2}+d^{2}\right )}{\left (i d -c \right )^{2} \left (i d +c \right )^{3} \left (c +d \tan \left (f x +e \right )\right )}+\frac {i \ln \left (\tan \left (f x +e \right )+i\right )}{4 \left (i d -c \right )^{2}}+\frac {1}{2 \left (i d +c \right )^{2} \left (\tan \left (f x +e \right )-i\right )}+\frac {\left (-i c +5 d \right ) \ln \left (\tan \left (f x +e \right )-i\right )}{4 \left (i d +c \right )^{3}}}{f a}\) | \(163\) |
default | \(\frac {\frac {d^{2} \left (3 i c +d \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (i d -c \right )^{2} \left (i d +c \right )^{3}}-\frac {i d^{2} \left (c^{2}+d^{2}\right )}{\left (i d -c \right )^{2} \left (i d +c \right )^{3} \left (c +d \tan \left (f x +e \right )\right )}+\frac {i \ln \left (\tan \left (f x +e \right )+i\right )}{4 \left (i d -c \right )^{2}}+\frac {1}{2 \left (i d +c \right )^{2} \left (\tan \left (f x +e \right )-i\right )}+\frac {\left (-i c +5 d \right ) \ln \left (\tan \left (f x +e \right )-i\right )}{4 \left (i d +c \right )^{3}}}{f a}\) | \(163\) |
norman | \(\frac {\frac {1}{2 a f \left (-i c +d \right )}+\frac {c \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {c \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {d \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x \tan \left (f x +e \right )}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {d \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x \left (\tan ^{3}\left (f x +e \right )\right )}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {\left (3 i d^{3}+c^{3}\right ) \tan \left (f x +e \right )}{2 a f \left (-i d +c \right ) \left (i d +c \right )^{2} c}+\frac {d \left (i c d +3 d^{2}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{2 a \left (i c +d \right ) \left (-i c +d \right )^{2} f c}}{\left (1+\tan ^{2}\left (f x +e \right )\right ) \left (c +d \tan \left (f x +e \right )\right )}+\frac {i d^{2} \left (3 i c +d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 a f \left (-i c^{5}-2 i c^{3} d^{2}-i c \,d^{4}+c^{4} d +2 c^{2} d^{3}+d^{5}\right )}-\frac {i d^{2} \left (3 i c +d \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{a f \left (-i c^{5}-2 i c^{3} d^{2}-i c \,d^{4}+c^{4} d +2 c^{2} d^{3}+d^{5}\right )}\) | \(480\) |
risch | \(-\frac {x}{2 a \left (2 i c d -c^{2}+d^{2}\right )}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )}}{4 a \left (2 i c d +c^{2}-d^{2}\right ) f}+\frac {6 d^{2} c x}{a \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}+\frac {6 d^{2} c e}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}-\frac {2 i d^{3} x}{a \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}-\frac {2 i d^{3} e}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}-\frac {2 i d^{3}}{\left (-i c +d \right )^{2} f a \left (i c +d \right )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )} d +i c \,{\mathrm e}^{2 i \left (f x +e \right )}-d +i c \right )}+\frac {3 i d^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) c}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}+\frac {d^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right )}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}\) | \(493\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.35, size = 336, normalized size = 1.66 \begin {gather*} \frac {i \, c^{4} + 2 i \, c^{2} d^{2} + i \, d^{4} + 2 \, {\left (c^{4} + 2 i \, c^{3} d + 12 \, c^{2} d^{2} - 14 i \, c d^{3} - 5 \, d^{4}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (i \, c^{4} + 2 \, c^{3} d - 6 \, c d^{3} - 9 i \, d^{4} + 2 \, {\left (c^{4} + 4 i \, c^{3} d + 6 \, c^{2} d^{2} + 4 i \, c d^{3} + 5 \, d^{4}\right )} f x\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 4 \, {\left ({\left (-3 i \, c^{2} d^{2} - 4 \, c d^{3} + i \, d^{4}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-3 i \, c^{2} d^{2} + 2 \, c d^{3} - i \, d^{4}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{4 \, {\left ({\left (a c^{6} + 3 \, a c^{4} d^{2} + 3 \, a c^{2} d^{4} + a d^{6}\right )} f e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (a c^{6} + 2 i \, a c^{5} d + a c^{4} d^{2} + 4 i \, a c^{3} d^{3} - a c^{2} d^{4} + 2 i \, a c d^{5} - a d^{6}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 14.84, size = 510, normalized size = 2.52 \begin {gather*} - \frac {2 d^{3}}{a c^{5} f + i a c^{4} d f + 2 a c^{3} d^{2} f + 2 i a c^{2} d^{3} f + a c d^{4} f + i a d^{5} f + \left (a c^{5} f e^{2 i e} - i a c^{4} d f e^{2 i e} + 2 a c^{3} d^{2} f e^{2 i e} - 2 i a c^{2} d^{3} f e^{2 i e} + a c d^{4} f e^{2 i e} - i a d^{5} f e^{2 i e}\right ) e^{2 i f x}} + \frac {x \left (c + 5 i d\right )}{2 a c^{3} + 6 i a c^{2} d - 6 a c d^{2} - 2 i a d^{3}} + \begin {cases} \frac {i e^{- 2 i f x}}{4 a c^{2} f e^{2 i e} + 8 i a c d f e^{2 i e} - 4 a d^{2} f e^{2 i e}} & \text {for}\: 4 a c^{2} f e^{2 i e} + 8 i a c d f e^{2 i e} - 4 a d^{2} f e^{2 i e} \neq 0 \\x \left (- \frac {c + 5 i d}{2 a c^{3} + 6 i a c^{2} d - 6 a c d^{2} - 2 i a d^{3}} + \frac {c e^{2 i e} + c + 5 i d e^{2 i e} + i d}{2 a c^{3} e^{2 i e} + 6 i a c^{2} d e^{2 i e} - 6 a c d^{2} e^{2 i e} - 2 i a d^{3} e^{2 i e}}\right ) & \text {otherwise} \end {cases} + \frac {i d^{2} \cdot \left (3 c - i d\right ) \log {\left (\frac {c + i d}{c e^{2 i e} - i d e^{2 i e}} + e^{2 i f x} \right )}}{a f \left (c - i d\right )^{2} \left (c + i d\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.59, size = 342, normalized size = 1.69 \begin {gather*} \frac {\frac {16 \, {\left (3 \, c d^{3} - i \, d^{4}\right )} \log \left (i \, d \tan \left (f x + e\right ) + i \, c\right )}{-2 i \, a c^{5} d + 2 \, a c^{4} d^{2} - 4 i \, a c^{3} d^{3} + 4 \, a c^{2} d^{4} - 2 i \, a c d^{5} + 2 \, a d^{6}} - \frac {2 \, {\left (i \, c - 5 \, d\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a c^{3} + 3 i \, a c^{2} d - 3 \, a c d^{2} - i \, a d^{3}} - \frac {16 \, \log \left (-i \, \tan \left (f x + e\right ) + 1\right )}{8 i \, a c^{2} + 16 \, a c d - 8 i \, a d^{2}} + \frac {i \, c^{2} d \tan \left (f x + e\right )^{2} - 2 \, c d^{2} \tan \left (f x + e\right )^{2} - i \, d^{3} \tan \left (f x + e\right )^{2} + i \, c^{3} \tan \left (f x + e\right ) + 3 \, c^{2} d \tan \left (f x + e\right ) - 15 i \, c d^{2} \tan \left (f x + e\right ) - 13 \, d^{3} \tan \left (f x + e\right ) + 5 \, c^{3} - 6 i \, c^{2} d - 13 \, c d^{2} + 8 i \, d^{3}}{{\left (a c^{4} + 2 \, a c^{2} d^{2} + a d^{4}\right )} {\left (d \tan \left (f x + e\right )^{2} + c \tan \left (f x + e\right ) - i \, d \tan \left (f x + e\right ) - i \, c\right )}}}{8 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.77, size = 1334, normalized size = 6.60 \begin {gather*} \frac {\sum _{k=1}^3\ln \left (-\mathrm {root}\left (a^3\,c^5\,d^5\,e^3\,192{}\mathrm {i}+a^3\,c^7\,d^3\,e^3\,128{}\mathrm {i}+a^3\,c^3\,d^7\,e^3\,128{}\mathrm {i}+48\,a^3\,c^8\,d^2\,e^3-48\,a^3\,c^2\,d^8\,e^3+32\,a^3\,c^6\,d^4\,e^3-32\,a^3\,c^4\,d^6\,e^3+a^3\,c^9\,d\,e^3\,32{}\mathrm {i}+a^3\,c\,d^9\,e^3\,32{}\mathrm {i}-16\,a^3\,d^{10}\,e^3+16\,a^3\,c^{10}\,e^3+135\,a\,c^2\,d^4\,e+a\,c^3\,d^3\,e\,12{}\mathrm {i}-3\,a\,c^4\,d^2\,e-a\,c\,d^5\,e\,90{}\mathrm {i}+a\,c^5\,d\,e\,6{}\mathrm {i}-21\,a\,d^6\,e+a\,c^6\,e-c^2\,d^2\,3{}\mathrm {i}+14\,c\,d^3-d^4\,5{}\mathrm {i},e,k\right )\,\left (\left (-a\,c^2\,d^2+2{}\mathrm {i}\,a\,c\,d^3+a\,d^4\right )\,\left (2\,a\,c^6+8{}\mathrm {i}\,a\,c^5\,d-2\,a\,c^4\,d^2+16{}\mathrm {i}\,a\,c^3\,d^3-10\,a\,c^2\,d^4+8{}\mathrm {i}\,a\,c\,d^5-6\,a\,d^6\right )+\mathrm {root}\left (a^3\,c^5\,d^5\,e^3\,192{}\mathrm {i}+a^3\,c^7\,d^3\,e^3\,128{}\mathrm {i}+a^3\,c^3\,d^7\,e^3\,128{}\mathrm {i}+48\,a^3\,c^8\,d^2\,e^3-48\,a^3\,c^2\,d^8\,e^3+32\,a^3\,c^6\,d^4\,e^3-32\,a^3\,c^4\,d^6\,e^3+a^3\,c^9\,d\,e^3\,32{}\mathrm {i}+a^3\,c\,d^9\,e^3\,32{}\mathrm {i}-16\,a^3\,d^{10}\,e^3+16\,a^3\,c^{10}\,e^3+135\,a\,c^2\,d^4\,e+a\,c^3\,d^3\,e\,12{}\mathrm {i}-3\,a\,c^4\,d^2\,e-a\,c\,d^5\,e\,90{}\mathrm {i}+a\,c^5\,d\,e\,6{}\mathrm {i}-21\,a\,d^6\,e+a\,c^6\,e-c^2\,d^2\,3{}\mathrm {i}+14\,c\,d^3-d^4\,5{}\mathrm {i},e,k\right )\,\left (\left (-a\,c^2\,d^2+2{}\mathrm {i}\,a\,c\,d^3+a\,d^4\right )\,\left (32\,a^2\,c^7\,d+a^2\,c^6\,d^2\,64{}\mathrm {i}+32\,a^2\,c^5\,d^3+a^2\,c^4\,d^4\,128{}\mathrm {i}-32\,a^2\,c^3\,d^5+a^2\,c^2\,d^6\,64{}\mathrm {i}-32\,a^2\,c\,d^7\right )+\mathrm {tan}\left (e+f\,x\right )\,\left (-a\,c^2\,d^2+2{}\mathrm {i}\,a\,c\,d^3+a\,d^4\right )\,\left (-8\,a^2\,c^8-a^2\,c^7\,d\,16{}\mathrm {i}+16\,a^2\,c^6\,d^2+a^2\,c^5\,d^3\,16{}\mathrm {i}+32\,a^2\,c^4\,d^4+a^2\,c^3\,d^5\,80{}\mathrm {i}-16\,a^2\,c^2\,d^6+a^2\,c\,d^7\,48{}\mathrm {i}-24\,a^2\,d^8\right )\right )+\mathrm {tan}\left (e+f\,x\right )\,\left (-a\,c^2\,d^2+2{}\mathrm {i}\,a\,c\,d^3+a\,d^4\right )\,\left (4\,a\,c^5\,d+28{}\mathrm {i}\,a\,c^4\,d^2-8\,a\,c^3\,d^3+40{}\mathrm {i}\,a\,c^2\,d^4-12\,a\,c\,d^5+12{}\mathrm {i}\,a\,d^6\right )\right )-\left (-a\,c^2\,d^2+2{}\mathrm {i}\,a\,c\,d^3+a\,d^4\right )\,\left (c^3\,d+11\,c\,d^3-d^4\,6{}\mathrm {i}\right )+\mathrm {tan}\left (e+f\,x\right )\,\left (-a\,c^2\,d^2+2{}\mathrm {i}\,a\,c\,d^3+a\,d^4\right )\,\left (-c^2\,d^2+c\,d^3\,6{}\mathrm {i}+9\,d^4\right )\right )\,\mathrm {root}\left (a^3\,c^5\,d^5\,e^3\,192{}\mathrm {i}+a^3\,c^7\,d^3\,e^3\,128{}\mathrm {i}+a^3\,c^3\,d^7\,e^3\,128{}\mathrm {i}+48\,a^3\,c^8\,d^2\,e^3-48\,a^3\,c^2\,d^8\,e^3+32\,a^3\,c^6\,d^4\,e^3-32\,a^3\,c^4\,d^6\,e^3+a^3\,c^9\,d\,e^3\,32{}\mathrm {i}+a^3\,c\,d^9\,e^3\,32{}\mathrm {i}-16\,a^3\,d^{10}\,e^3+16\,a^3\,c^{10}\,e^3+135\,a\,c^2\,d^4\,e+a\,c^3\,d^3\,e\,12{}\mathrm {i}-3\,a\,c^4\,d^2\,e-a\,c\,d^5\,e\,90{}\mathrm {i}+a\,c^5\,d\,e\,6{}\mathrm {i}-21\,a\,d^6\,e+a\,c^6\,e-c^2\,d^2\,3{}\mathrm {i}+14\,c\,d^3-d^4\,5{}\mathrm {i},e,k\right )}{f}-\frac {\frac {-2\,c^2+c\,d\,2{}\mathrm {i}+4\,d^2}{4\,a\,d\,\left (c^3+c^2\,d\,1{}\mathrm {i}+c\,d^2+d^3\,1{}\mathrm {i}\right )}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (c-d\,3{}\mathrm {i}\right )}{2\,a\,\left (c^3+c^2\,d\,1{}\mathrm {i}+c\,d^2+d^3\,1{}\mathrm {i}\right )}}{f\,\left (\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {c}{d}-\mathrm {i}\right )+{\mathrm {tan}\left (e+f\,x\right )}^2-\frac {c\,1{}\mathrm {i}}{d}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________